# print(1 + 2 - 3)
# print(1 + 2 * 3)
# print(1 + 2 / 3)
#
# print((167.5 + 89.0 + 12.9 + 32.0) / 4 )
#
# print((167.5 + 89.0 + 12.9 + 32.0) / 4 )
#
# # 变量
# avg = (67.5 + 89.0 + 12.9 + 32.0) / 4
# total = (67.5 - avg) ** 2 + (89.0 - avg) ** 2 + (12.9 - avg) ** 2 + (32.0 - avg) ** 2
# result = total / 3
# print(result)
#
# # 变量赋值
# a = 10
# b = a
# print(b)
#
# #变量修改
# a  = 20
# print(a)
#
# # 变量的类型
# # 整型
# a = 10 # 整形的范围：无穷，可自动扩容
# print(type(a))
# #浮点数(float\double 都一样)
# b = 10.1
# print(type(b))
# #字符串 (单引号' 和 双引号" 都可以)
# c = 'hello'
# print(type(c))
# d = "hello"
# print(type(d))
# e = 'My name is "xiaolufei"'
# print(type(e))
# f = '''My 'name' is "xiaolufei"'''
# print(type(f))
#
# # 求字符串的长度
# print(len(d))
# # 字符串拼接：字符直接拼接
# print(c + d)
# # 字符串 和 整数 不能拼接
# #print(a + c)
#
# #布尔类型
# c1 = True
# c2 = False
# print(type(c1))
# print(type(c2))

# #动态类型特征:随着程序的运行，发生改变
# a = 10
# print(type(a))
# a = 'hello'
# print(type(a))
# a = True
# print(type(a))

"""
文档字符串
"""

#格式化字符串
# 可以使用{}语法，往字符串嵌入变量或表达式
# a = 10
# b = 5
# print(f"a = {a}")
# print(f"a = {a - b}")

# 通过控制台，来输入一个数据
# num = input('请输入一个整数：')
# print(type(num))
# print(f'您输入的数字是: {num}')

# 通过控制台，来输入一个数据
# 对用户的输入内容进行计算：str -转化-> int
# int()
# float()
# str()
# a = input('请输入第一个整数：') # str
# b = input('请输入第一个整数：')
# a = int(a) # 类型强制转换int
# b = int(b)
# print(f'a + b = {a + b}')


# 输入四个小数，求四个小数的平均值
# a = input('请输入第一个小数：')
# b = input('请输入第二个小数：')
# c = input('请输入第三个小数：')
# d = input('请输入第四个小数：')
# a = float(a)
# b = float(b)
# c = float(c)
# d = float(d)
# avg = (a + b + c + d) / 4
# print(f'四个小数的平均值为：{avg}')

# python 中 0 不能作为除数！
# print(10 / 0)

# print(7 % 3)
#
# # 乘方
# print(4 ** 2)
# print(4 ** 0.5)
# # // 地板除法(取整除法)，会对计算的结果进行“向下取整”
# print(7 // 2) # 3
# print(-7 // 2) # -4

# a = 10
# b = 20
# print(a > b)
# print(a < b)
# print(a == b)

# 比较字符串： 按照 字典序！
# 针对中文进行字符串大小比较是没有意义的
# a = 'abhu'
# b = 'bsud'
# c = 'chig'
# print(a > b)
# print(a < b)
# print(a == b)
# print(a != b)

# print(0.1)
# print(0.2)
# print(0.1 + 0.2) # 0.30000000000000004
# print(0.3)
# a = 0.1
# b = 0.2
# print(-0.000001 < (a + b) < 0.000001)

# a = 10
# b = 20
# c = 30
#
# print( a < b and b < c) # T
# print(a > b or b < c) # T
# print(not a < b) # F

# 多元赋值
a, b = 1, 2
#
# tmp = a
# a = b
# b = tmp
# print(a, b)

a, b = b, a
print(a, b)